jGfx_GInst Plugin Command Reference
////////////////////////////////////////////



===========================================================================================================================
GInst Commands (35 total)
===========================================================================================================================


pGInst = GInst_MakeNew( [ bDrawBatching ] )
---------------------------------------------------------------------------------------------------------------------------
Allocates a new GInst and returns it's pointer. GInst(s) are templates from which instances are rendered. GInsts are templates for from which instances are rendered. They are used by GInstBuffers as a source for effects, meshes, textures, lod settings, and custom elements. GInsts are expected to be fully setup before creating GInstBuffers which reference their data. If the optional bDrawBatching argument is set to true, the GInst will be created to use batch rendering. Batching can greatly reduce cpu load in GInstBuffer heavy scenes, but is not appropriate in cases where only a single GInstBuffer is rendered from a particular GInst.


GInst_Delete pGInst
---------------------------------------------------------------------------------------------------------------------------
Deallocates a GInst and deletes any GInstBuffers which reference it's data.


GInst_SetObject pGInst, ObjectID
---------------------------------------------------------------------------------------------------------------------------
Sets up a GInst's mesh list using (all of) an object's limbs. The object should be fully textured before calling this command; Texture references are collected at this time.


GInst_BeginObjectAssembly pGInst
---------------------------------------------------------------------------------------------------------------------------
An alternative to GInst_SetObject which allows manual assembly of a GInst's mesh list. After calling this command, object limbs can be added to the mesh list using the GInst_AddMesh command.


GInst_AddMesh pGInst, ObjectID, LimbID
---------------------------------------------------------------------------------------------------------------------------
Adds the specified limb to a GInst's mesh list. The limb should be fully textured before calling this command; Texture references are collected at this time. GInst_BeginObjectAssembly must be called before calling this command. GInst_FinishObjectAssembly must be called after all meshes have been added.


GInst_FinishObjectAssembly pGInst
---------------------------------------------------------------------------------------------------------------------------
Concludes manual assembly of a GInst's mesh list. This command must be called after all meshes have been defined using the GInst_AddMesh command


MeshCount = GInst_GetMeshCount( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns the total number of meshes within the GInst's render mesh list. 


ObjectID = GInst_GetMeshObject( pGInst, MeshIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the ID of the object which contains the specified mesh's data. Mesh indices are 0-based.


LimbID = GInst_GetMeshLimb( pGInst, MeshIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the ID of the limb which contains the specified mesh's data. Mesh indices are 0-based.


GInst_SetEffect pGInst, EffectID
---------------------------------------------------------------------------------------------------------------------------
Applies an effect to the the GInst. The specified effect's vertex shader must have been specifically written for use with the GInst library.


EffectID = GInst_GetEffect( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns the ID of an effect which was previously applied using GInst_SetEffect


GInst_SetCameraMask pGInst, dwMaskBits
---------------------------------------------------------------------------------------------------------------------------
Sets a GInst's camera bit mask


dwMaskBits = GInst_GetCameraMask( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns a GInst's camera bit mask


GInst_SetHidden pGInst, bHidden
---------------------------------------------------------------------------------------------------------------------------
Toggles the exclusion of all GInstBuffers which source render data from the specified GInst


bHidden = GInst_GetHidden( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns true if the specified GInst is currently excluded from rendering


GInst_SetRenderPriority pGInst, iPriority
---------------------------------------------------------------------------------------------------------------------------
Used to set a GInst's priority within the render queue. After setting GInst priority values, the GInst_Sort command should be used to actually sort the GInsts.


iPriority = GInst_GetRenderPriority( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns the priority value which was assigned during a previous call to GInst_SetRenderPriority


GInst_Sort
---------------------------------------------------------------------------------------------------------------------------
Sorts the internal GInst list using their assigned priority values. Sorting will be performed in descending order, higher priorities will be rendered first.


Index = GInst_GetRenderIndex( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns a GInst's index within the plugin's render queue. The returned indices are 1-based.


GInst_SetLODLevels pGInst, NumLevels
---------------------------------------------------------------------------------------------------------------------------
Defines the number of LOD levels the GInst will use for rendering.


NumLevels = GInst_GetLODLevels( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of LOD levels which the GInst is configured to utilize.


GInst_SetLODDistance pGInst, LevelIndex, Distance#
---------------------------------------------------------------------------------------------------------------------------
Sets the distance at which the specified LOD level should begin rendering. LOD Level indices are 0-based, but only level 1 and beyond can be specified. Because instances are rendered in groups, distances are percieved as being values beyond the GInstBuffer's bounds. GInstBuffers with smaller bounding boxes will switch LOD levels sooner than a GInstBuffer with larger bounds.


Distance# = GInst_GetLODDistance( pGInst, LevelIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the distance at which the specified LOD is configured to begin rendering. LOD Level indices are 0-based.


GInst_SetMeshLOD pGInst, MeshIndex, LevelIndex
---------------------------------------------------------------------------------------------------------------------------
Sets the LOD level which will use the specified mesh for rendering. Multiple meshes can be assigned to each LOD level.


LevelIndex = GInst_GetMeshLOD( pGInst, MeshIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the LOD level which uses the specified mesh for rendering.


GInst_SetMeshCameraMask pGInst, MeshIndex, dwCameraMask
---------------------------------------------------------------------------------------------------------------------------
Sets a custom camera mask for a specific mesh, Can be used to assign subsets of meshes to each camera individually. All cameras flagged by dwCameraMask mask must be present within the GInst's mask as well, meshes will only render to cameras which are flagged within the GInst's camera mask.


dwCameraMask = GInst_GetMeshCameraMask( pGInst, MeshIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns a mesh's custom camera mask


GInst_SetMaxDrawDistance pGInst, Distance#
---------------------------------------------------------------------------------------------------------------------------
Specifies the maximum distance at which the specified GInst should render.


Distance# = GInst_SetMaxDrawDistance( pGInst )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum draw distance which the specified GInst has been configured to render.


GInst_DeclareCustomElements pGInst, bWorldMat
---------------------------------------------------------------------------------------------------------------------------
Begins a GInst's custom element declaration. Custom elements are used to store unique data on a per-instance basis, allowing each instance to be rendered with unique properties. If bWorldMat is true, the plugin's internal world matrix system will be used to calculate and pass instance transforms. After calling this command, GInst_AddCustomElement should be used to declare individual elements.


GInst_AddCustomElement pGInst, DeclType, DeclUsage
---------------------------------------------------------------------------------------------------------------------------
Declares a new custom element which will be used to represent unique data for each instance. DeclType is used to specify the new element's datatype using the D3DDECLTYPE_ constants. DeclUsage is used to specify specify the HLSL semantic which will be used to pass the new element to the effect's vertex shader using the D3DDECLUSAGE_ constants. It should be noted that graphics hardware is not guaranteed to support all element datatypes provided by D3D9. In cases where possibly unsupported datatypes are used, the application should fall back to passing element data using the 32bit FLOAT and D3DCOLOR datatypes. After all custom elements have been added, GInst_FinishCustomElements must be called to finalize the declaration.


GInst_FinishCustomElements pGInst
---------------------------------------------------------------------------------------------------------------------------
Finalizes a GInst's custom element declaration


count = GInst_GetDrawCalls( [CameraID] )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of GInst draw calls which were submitted during the specified camera's last render. If no CameraID is specified, the combined total of all cameras will be returned.


count = GInst_GetDrawPrimitives( [CameraID] )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of GInst primitives which were rendered during the specified camera's last render. If no CameraID is specified, the combined total of all cameras will be returned.


count = GInst_GetDrawInstances( [CameraID] )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of GInst Instances which were rendered during the specified camera's last render. If no CameraID is specified, the combined total of all cameras will be returned.










===========================================================================================================================
GInstBuffer Commands (66 Total)
===========================================================================================================================

pGInstBuffer = GInstBuffer_MakeNew( pGInst, InstanceCount [, bDynamic ] )
---------------------------------------------------------------------------------------------------------------------------
Creates a new GInstBuffer to render from the specified GInst and returns it's pointer. GInstBuffers are used to store and render lists of geometry instances. Each GInstBuffer represents a single draw call. The specified GInst must be fully setup before calling this command. InstanceCount specifies the maximum number of instances the buffer can contain, must greater than zero. Setting the optional bDynamic argument to true can allow driver-level optimization for buffers which are frequently updated. The bDynamic argument only has meaning if the source GInst does not utilize batch rendering.


GInstBuffer_Delete pGInstBuffer
---------------------------------------------------------------------------------------------------------------------------
Deletes a GInstBuffer and removes it from it's parent group (if applicable)


GInstBuffer_Resize pGInstBuffer, InstanceCount
---------------------------------------------------------------------------------------------------------------------------
Resizes a GInstBuffer to change maximum number of instances it can contain. InstanceCount must greater than zero.


InstanceCount = GInstBuffer_GetSize( pGInstBuffer ) 
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum number of instances which can be stored within the specified GInstBuffer.


pGInst = GInstBuffer_GetGInst( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns a pointer to the GInst which the specified GInstBuffer renders from


GInstBuffer_SetActiveInstanceCount pGInstBuffer, InstanceCount
---------------------------------------------------------------------------------------------------------------------------
Sets the number of instances within the buffer which are considered to be in use. Provides an alternative method of instance exclusion. InstanceCount cannot exceed the buffer's size.


InstanceCount = GInstBuffer_GetActiveInstanceCount( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of currently active instances within the specified InstBuffer.


GInstBuffer_SetHidden pGInstBuffer, bHidden
---------------------------------------------------------------------------------------------------------------------------
Used to toggle exclusion on a per-GInstBuffer basis.


bHidden = GInstBuffer_GetHidden( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns a GInstBuffer's current exclusion status.


GInstBuffer_SetCullingEnabled pGInstBuffer, bEnabled [, DistanceMode ]
---------------------------------------------------------------------------------------------------------------------------
Toggles culling for the specified GInstBuffer. By default, GInstBuffers are created with culling enabled. If culling is disabled, no culling test will be performed before rendering the buffer. If the GInstBuffer belongs to a group, rendering will be dependant on that group passing it's culling test reguardless of the buffer's personal culling settings. The optional DistanceMode argument can be used to select the method of distance calculation used for LOD selection; 0=Pythagorean (default), 1=Frustum Near-Plane.


bEnabled = GInstBuffer_GetCullingEnabled( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns true if the GInstBuffer is configured to use culling.


GInstBuffer_SetGroup pGInstBuffer, pGInstGroup
---------------------------------------------------------------------------------------------------------------------------
Adds a GInstBuffer to the specified GInstGroup. Buffers can only exist within a single group at a time, any previous group association will be removed in favor of the new group. GInstBuffers which are added to a group can take advantage of early culling rejection and approval using their group's culling test results. Set pGInstGroup to 0 to remove the buffer from it's current group.


pGInstGroup = GInstBuffer_GetGroup( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns a pointer to a GInstBuffer's group. Returns 0 if the buffer doesnt exist within a groups.


GInstBuffer_SetPosition pGInstBuffer, InstIndex, X#, Y#, Z#
---------------------------------------------------------------------------------------------------------------------------
Sets a buffer instance's world space position. Instance Indices are 1-based.


X# = GInstBuffer_GetPositionX( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space X position coordinate. Instance Indices are 1-based.


Y# = GInstBuffer_GetPositionY( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space Y position coordinate. Instance Indices are 1-based.


Z# = GInstBuffer_GetPositionZ( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space Z position coordinate. Instance Indices are 1-based.


GInstBuffer_SetRotation pGInstBuffer, InstIndex, X#, Y#, Z#
---------------------------------------------------------------------------------------------------------------------------
Sets a buffer instance's world space rotation. Angles are specified in euler degrees. Instance Indices are 1-based.


X# = GInstBuffer_GetAngleX( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space X angle. Instance Indices are 1-based.


Y# = GInstBuffer_GetAngleY( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space Y position coordinate. Instance Indices are 1-based.


Z# = GInstBuffer_GetAngleZ( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's world space Z position coordinate. Instance Indices are 1-based.


GInstBuffer_SetScale pGInstBuffer, InstIndex, Scale#
GInstBuffer_SetScale pGInstBuffer, InstIndex, X#, Y#, Z#
---------------------------------------------------------------------------------------------------------------------------
Sets a buffer instance's local scale. Values are specified using percent values, where 100 = no scaling. Instance Indices are 1-based.


X# = GInstBuffer_GetScaleX( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's local X scale value. Instance Indices are 1-based.


Y# = GInstBuffer_GetScaleY( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's local Y scale value. Instance Indices are 1-based.


Z# = GInstBuffer_GetScaleZ( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns the specified instance's local Z scale value. Instance Indices are 1-based.


GInstBuffer_UpdateInstance pGInstBuffer, InstIndex
---------------------------------------------------------------------------------------------------------------------------
Updates an instance's world matrix and culling bounds. Must be called after altering an instance's position, rotation or scale. Instance Indices are 1-based.


GInstBuffer_SetWorldMatrix pGInstBuffer, InstIndex, pMat4
---------------------------------------------------------------------------------------------------------------------------
Sets an instance's world matrix using a Matrix4 structure pointer. The _GetPosition, _GetAngle and _GetScale commands will not work if instance transforms are set using this command. Instance Indices are 1-based.


GInstBuffer_GetWorldMatrix pGInstBuffer, InstIndex, pMat4
---------------------------------------------------------------------------------------------------------------------------
Copies an instance's matrix into the specified Matrix4 structure pointer. Instance Indices are 1-based.


GInstBuffer_SetExcluded pGInstBuffer, InstIndex, bExcluded
---------------------------------------------------------------------------------------------------------------------------
Toggles the exclusion of an instance within the specified GInstBuffer. Instance Indices are 1-based.


bExcluded = GInstBuffer_GetExcluded( pGInstBuffer, InstIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns true if the specified GInstBuffer is currently excluded.


GInstBuffer_SetFloat pGInstBuffer, InstIndex, ElementIndex, Value#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the Float1 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


GInstBuffer_SetFloat2 pGInstBuffer, InstIndex, ElementIndex, X#, Y#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the Float2 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


GInstBuffer_SetFloat3 pGInstBuffer, InstIndex, ElementIndex, X#, Y#, Z#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the Float3 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


GInstBuffer_SetFloat4 pGInstBuffer, InstIndex, ElementIndex, X#, Y#, Z#, W#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the Float4 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


Value# = GInstBuffer_GetFloat( pGInstBuffer, InstIndex, ElementIndex, FloatIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the 32bit FLOAT datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. Float Indices are 0-based.


GInstBuffer_SetUByte4 pGInstBuffer, InstIndex, ElementIndex, ByteX, ByteY, ByteZ, ByteW
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the UBYTE4, UBYTE4N and D3DCOLOR datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. UByte values range from 0 to 255.


ByteVal = InstBuffer_GetUByte( pGInstBuffer, InstIndex, ElementIndex, ByteIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the UBYTE4, UBYTE4N or D3DCOLOR datatype. Custom Element Indices are 1-based. Byte Indices are 0-based.


GInstBuffer_SetDword pGInstBuffer, InstIndex, ElementIndex, DwValue
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the UBYTE4, UBYTE4N and D3DCOLOR datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based.


DwValue = GInstBuffer_GetDword( pGInstBuffer, InstIndex, ElementIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used ot retrieve custom element values from elements which were declared using the UBYTE4, UBYTE4N and D3DCOLOR datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based.


GInstBuffer_SetUShort2 pGInstBuffer, InstIndex, ElementIndex, X, Y
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the USHORT2N datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. UShort values range from 0 to 65535.


GInstBuffer_SetUShort4 pGInstBuffer, InstIndex, ElementIndex, X, Y, Z, W
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the USHORT4N datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. UShort values range from 0 to 65535.


UShortVal = InstBuffer_GetUShort( pGInstBuffer, InstIndex, ElementIndex, UShortIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the USHORT2N and USHORT4N datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. UShort Indices are 0-based.


GInstBuffer_SetShort2 pGInstBuffer, InstIndex, ElementIndex, X, Y
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the SHORT2 and SHORT2N datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. Short values range from 32768 to 32767.


GInstBuffer_SetShort4 pGInstBuffer, InstIndex, ElementIndex, X, Y, Z, W
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the SHORT4 and SHORT4N datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. Short values range from 32768 to 32767.


ShortVal = InstBuffer_GetShort( pGInstBuffer, InstIndex, ElementIndex, ShortIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the SHORT2, SHORT2N, SHORT4, and SHORT4N datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. Short Indices are 0-based.


GInstBuffer_SetUDec3 pGInstBuffer, InstIndex, ElementIndex, X, Y, Z
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the UDEC3 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. UDec values range from 0 to 1023.


UDecVal = InstBuffer_GetUDec( pGInstBuffer, InstIndex, ElementIndex, UDecIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the UDEC3 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. UDec Indices are 0-based.


GInstBuffer_SetDec3 pGInstBuffer, InstIndex, ElementIndex, X, Y, Z
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the DEC3N datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. Dec values range from -512 to 511


DecVal = InstBuffer_GetDec( pGInstBuffer, InstIndex, ElementIndex, DecIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the DEC3N datatype. Instance Indices are 1-based. Custom Element Indices are 1-based. Dec Indices are 0-based.


GInstBuffer_SetFloat16X2 pGInstBuffer, InstIndex, ElementIndex, X#, Y#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the FLOAT16_2 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


GInstBuffer_SetFloat16X4 pGInstBuffer, InstIndex, ElementIndex, X#, Y#, Z#, W#
---------------------------------------------------------------------------------------------------------------------------
This command is used to set custom element values for elements which were declared using the FLOAT16_4 datatype. Instance Indices are 1-based. Custom Element Indices are 1-based.


Value# = GInstBuffer_GetFloat16( pGInstBuffer, InstIndex, ElementIndex, FloatIndex )
---------------------------------------------------------------------------------------------------------------------------
This command is used to retrieve individual component values of instance custom elements which were declared using the 16bit FLOAT datatypes. Instance Indices are 1-based. Custom Element Indices are 1-based. Float Indices are 0-based.


GInstBuffer_Update pGInstBuffer [, bUpdateBounds ]
---------------------------------------------------------------------------------------------------------------------------
Updates an instance buffer using the current instance data. If the optional bUpdateBounds flag is set to true, the buffer's culling bounds will also be recalculated. If culling is enabled, the buffer's bounds must be updated at least once. If the bUpdateBounds argument is omitted, the GInstBuffer's automatic bounds calculation flag will be used.


GInstBuffer_SetAutoBoundsEnabled pGInstBuffer, bEnabled
---------------------------------------------------------------------------------------------------------------------------
Toggles automatic bounds updates for the specified GInstBuffer. Disabling automatic updates will prevent the plugin from altering bounds which were manually defined using GInstBuffer_SetBounds


bool = GInstBuffer_GetAutoBoundsEnabled( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns true if automatic bounds recalculation is enabled for the specified GInstBuffer


GInstBuffer_SetBounds pGInstBuffer, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
---------------------------------------------------------------------------------------------------------------------------
Used to manually specify the minimum and maximum extents of a GInstBuffer's bounding box.


Value# = GInstBuffer_SetBoundsMinX( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstBuffer's bounding box on the X axis


Value# = GInstBuffer_SetBoundsMinY( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstBuffer's bounding box on the Y axis


Value# = GInstBuffer_SetBoundsMinZ( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstBuffer's bounding box on the Z axis


Value# = GInstBuffer_SetBoundsMaxX( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstBuffer's bounding box on the X axis


Value# = GInstBuffer_SetBoundsMaxY( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstBuffer's bounding box on the Y axis


Value# = GInstBuffer_SetBoundsMaxZ( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstBuffer's bounding box on the Z axis


Value# = GInstBuffer_SetBoundsCenterX( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstBuffer's bounding box on the X axis


Value# = GInstBuffer_SetBoundsCenterY( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstBuffer's bounding box on the Y axis


Value# = GInstBuffer_SetBoundsCenterZ( pGInstBuffer )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstBuffer's bounding box on the Z axis



GInstBuffer_CalculateBounds GInstBuffer
---------------------------------------------------------------------------------------------------------------------------
Recalculates a GInstBuffer's bounding volume. Only needs to be called if automatic bounds calculations have been disabled.









===========================================================================================================================
GInstGroup Commands (25 Total)
===========================================================================================================================


pGInstGroup = GInstGroup_MakeNew( [ pGInstGroup ] )
---------------------------------------------------------------------------------------------------------------------------
Creates a new GInstGroup and returns it's pointer. GInstGroups are used to aggrigate GInstBuffers for easy exclusion and culling. If the pGInstGroup argument is used the new group will be created as a child of the specified group, allowing for the creation of bounding volume hierarchies. Using groups in this way allows the plugin to speed up culling via early rejection/approval.


GInstGroup_Delete pGInstGroup, bDeleteBuffers
---------------------------------------------------------------------------------------------------------------------------
Deletes a GInstGroup as well as it's child groups. If bDeleteBuffers is true, any GInstBuffers contained within the group hierarchy will also be deleted.


GInstGroup_SetHidden pGInstGroup, bHidden
---------------------------------------------------------------------------------------------------------------------------
Toggles visibillity for the specified group and it's children.


bHidden = GInstGroup_GetHidden( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns true if the specified GInstGroup is currently hidden.


GInstGroup_SetCullingEnabled pGInstGroup, bEnabled
---------------------------------------------------------------------------------------------------------------------------
Used to toggle culling for the specified GInstGroup. If the GInstGroup is the child of another group, rendering will be dependant on the parent passing it's culling test reguardless of the group's personal culling settings.


bEnabled = GInstGroup_GetCullingEnabled( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns true if the GInstGroup is configured to use culling.


pGInstGroup = GInstGroup_GetParentGroup( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns a pointer to the specified GInstGroup's parent group. Returns 0 if the group has no parent (is root)


Count = GInstGroup_GetChildGroupCount( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of groups which exist as children of the specified group.


pGInstGroup = GInstGroup_GetChildGroup( pGInstGroup, ChildIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns a pointer to a group's child group. Child indices are 0-based.


Count = GInstGroup_GetInstBufferCount( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the number of GInstBuffers which exist within the specified group.


pGInstBuffer = GInstGroup_GetInstBuffer( pGInstGroup, BufferIndex )
---------------------------------------------------------------------------------------------------------------------------
Returns a pointer to a group's child GInstBuffer. Buffer indices are 0-based.


GInstGroup_SetAutoBoundsEnabled pGInstGroup, bEnabled
---------------------------------------------------------------------------------------------------------------------------
Toggles automatic bounds updates for the specified GInstBuffer. Disabling automatic updates will prevent the plugin from altering bounds which were manually defined using GInstBuffer_SetBounds


bool = GInstGroup_GetAutoBoundsEnabled( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns true if automatic bounds recalculation is enabled for the specified GInstGroup


GInstGroup_SetBounds pGInstGroup, MinX#, MinY#, MinZ#, MaxX#, MaxY#, MaxZ#
---------------------------------------------------------------------------------------------------------------------------
Used to manually specify the minimum and maximum extents of a GInstGroup's bounding box.


Value# = GInstGroup_SetBoundsMinX( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstGroup's bounding box on the X axis


Value# = GInstGroup_SetBoundsMinY( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstGroup's bounding box on the Y axis


Value# = GInstGroup_SetBoundsMinZ( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the minimum extent of a GInstGroup's bounding box on the Z axis


Value# = GInstGroup_SetBoundsMaxX( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstGroup's bounding box on the X axis


Value# = GInstGroup_SetBoundsMaxY( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstGroup's bounding box on the Y axis


Value# = GInstGroup_SetBoundsMaxZ( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the maximum extent of a GInstGroup's bounding box on the Z axis


Value# = GInstGroup_SetBoundsCenterX( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstGroup's bounding box on the X axis


Value# = GInstGroup_SetBoundsCenterY( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstGroup's bounding box on the Y axis


Value# = GInstGroup_SetBoundsCenterZ( pGInstGroup )
---------------------------------------------------------------------------------------------------------------------------
Returns the center of a GInstGroup's bounding box on the Z axis


GInstGroup_CalculateBounds GInstGroup
---------------------------------------------------------------------------------------------------------------------------
Recalculates a GInstGroup's bounding volume. Only needs to be called if automatic bounds calculations have been disabled.


GInstGroup_SetParentGroup GInstGroup, pParentGroup
---------------------------------------------------------------------------------------------------------------------------
Changes a GInstGroup's parent group.





===========================================================================================================================
GInstBatch Commands (4 Total)
===========================================================================================================================


GInstBatch_SetPoolManagement iMode [, ExpMul# ]
---------------------------------------------------------------------------------------------------------------------------
The plugin performs batch rendering using a dynamic instance pool. This command is used to control the expansion behavior of that pool.

iMode - Sets the plan which will be used when expanding the pool
ExpMul# - Optional parameter; Sets a multiplier which effects pool growth rate. Only valid with modes 1 or 2.

iMode 0 = Expands the pool to perfectly match the size of currently batched instances. While this mode ensures that the pool never grows larger than is required, 
it can lead to situations where the pool must be repeatedly expanded across consecutive frames. This mode is only recommended for collecting statistics which can be 
useful priming/flushing the buffer pool.
   If RequestedSize > CurrentSize
     NewSize = RequestedSize
     //Expand pool
   Endif

iMode 1 = Expands the pool in anticipation of the batched instance count increasing again in the near future. Expansion is determined based on required pool growth;
   If RequestedSize > CurrentSize
     Growth = RequestedSize - CurrentSize
     NewSize = CurrentSize + (Growth*ExpMul)
     //Expand pool
   Endif

iMode 2 = Expands the pool in anticipation of the batched instance count increasing again in the near future. Expansion is determined based on required pool size;
This mode can greatly reduce the risk of pool expansion, but is also capable of greatly overestimating the required pool size.
   If RequestedSize > CurrentSize
     NewSize = RequestedSize * ExpMul
     //Expand pool
   Endif


GInstBatch_PrimePool NumBytes
---------------------------------------------------------------------------------------------------------------------------
Expands the batch rendering instance pool by the specified number of bytes.


GInstBatch_FlushPool
---------------------------------------------------------------------------------------------------------------------------
Deallocates the batch rendering instance pool. The pool will be automatically recreated if GInstBatch_PrimePool is called, or if the pool is required during the next sync.


ByteSize = GInstBatch_GetPoolSize()
---------------------------------------------------------------------------------------------------------------------------
Returns the byte size of batch rendering instance pool.







===========================================================================================================================
Misc Commands (2 Total)
===========================================================================================================================


dwBitMask = Device_GetDeclTypeCaps()
---------------------------------------------------------------------------------------------------------------------------
Returns a bitmask whos flags indicate device support for vertex element datatypes. Datatype support can be checked by bitwise-anding the bitmask with the various D3DDTCAPS_ constants.



bool = Device_CheckGInstSupport()
---------------------------------------------------------------------------------------------------------------------------
Returns true if the graphics hardware supports rendering with concurrent data streams.


